﻿@using HopNguyenModel
@using HopNguyenModel
@model HopNguyenModel.Admin
@{
    ViewBag.Title = "Thêm nhóm trang";
    Layout = "~/Views/Shared/_BackendLayout.cshtml";
    List<TypePage> lstTypePage = ViewBag.lstTypePage;
}
<div class="page-header position-relative">
    <h1>Thêm nhóm trang cho tài khoản: @Model.Username
    </h1>
</div>
<div class="row-fluid">
    @if (ViewBag.msg == "success")
    {
        <div class="alert alert-success">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <strong>Thành công!</strong> Thêm mới thành công.
        </div>
    }
    <form id="validate" action="/cpanel/AddGroupPage" method="POST">
        <input type="hidden" name="AdminId" value="@Model.Id"/>
        <input type="hidden" name="AId" value="@Model.Id"/>
        <div class="formField">
            <div class="row-fluid">
                <div class="span2">
                    <span class="fLabel">Tên nhóm</span>
                </div>
                <div class="span9">
                    <input type="text" name="Name">
                </div>
            </div>
        </div>
        <div class="formButtons">
            <div class="row-fluid">
                <div class="span2"></div>
                <div class="span9">
                    <button class="btn btn-info" type="submit">
                        <i class="icon-ok bigger-110"></i>
                        Tạo mới
                    </button>
                </div>
            </div>
        </div>
    </form>

    <br />
    <br />
    <table id="sample-table-2" class="table table-striped table-bordered table-hover">
        <thead>
            <tr>
                <th>Mã</th>
                <th>Tên nhóm</th>
                <th>Thao tác</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in lstTypePage)
            {
                <tr>
                    <td>@item.Id</td>
                    <td><a href="/Cpanel/EditGroupPage/@item.Id">@item.Name</a></td>
                    <td>
                        <a href="/Cpanel/DeleteGroupPage/@item.Id?adminid=@Model.Id" onclick="javascript:return confirm('Are you sure?');" title="Xóa">Xóa</a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>

